import { createApp,ref } from 'vue' 
import App from './App.vue'
import router from './router'
//main.js 中 引入 cordova 
import { createPinia } from 'pinia'  
import piniaPluginPersist from 'pinia-plugin-persist'
// Vuetify
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import mitt from 'mitt' 
const app=createApp(App)
const Mit = mitt()
declare module 'vue' {
  export interface ComponentCustomProperties {
    $Bus: typeof Mit
  }
}
app.config.errorHandler = (err, instance, info) => {
  // 全局应用错误监听
  console.error('application-err：', err)
}
//vue3挂载全局API
app.config.globalProperties.$Bus = Mit 
 

//全局主题缓存数据
const pinia = createPinia()
pinia.use(piniaPluginPersist)  
app.use(pinia)
app.use(router)
// app.use(Carousel3d)
app.mount('#app').$nextTick(() => {
    postMessage({ payload: 'removeLoading' }, '*')
  })

